<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../plugins/vue.min.js"></script>
</head>
<body>
    <div id="box">
        <!-- 变得懒,不是实时的同步,失去焦点了才同步 -->
        <input type="text" v-model.lazy="myValue">
       {{myValue}}
       <br>
       <!-- 输入不是数字的,输入不了   加上v-model.number会把输入的字符转换成数字类型-->
       <input type="number" v-model.number="myAge">
       <br>
       <!-- 去除首尾空格 -->
       <input type="text" v-model.trim="myUsername">
       {{myUsername}}
    </div>
    <script>
        let vm = new Vue({
            el:"#box",
            data:{
                myValue:'',
                myAge:4,
                myUsername:''
                }
        })

       

    </script>
</body>
</html>